Generate source files.
In the Model Editor, select the entity for which you want to generate source files.
Choose Property
Generate Client Java File.
In the Choose Class Name panel verify the file name and location (
) and click Save.
Click OK when you're asked if you want to insert the files in the subproject.
For the same entity, choose Property
Generate Java FIle.
In the Choose Class Name panel verify the file name and location (main project) and click Save.
Click OK when you're asked if you want to insert the files in the main project.
When Project Builder generates a class file (such as Studio.java), it strips off the package prefix and inserts a package declaration near the top of the file. The class file also includes the necessary import declarations as well as the instance variables and accessor methods derived from the properties of the Studio entity.
Studio.java (ClientSideJava.subproj)
package businesslogic.client;
import com.apple.client.foundation.*;
import com.apple.client.eocontrol.*;
import java.util.*;
import java.math.BigDecimal;
public class Studio extends EOGenericRecord {
public static final String BudgetKey = "budget";
public static final String NameKey = "name";
public static final String MoviesKey = "movies";
public Studio(EOEditingContext context, EOClassDescription
classDesc, EOGlobalID gid) {
super(context, classDesc, gid);
}
public String name() {
return (String)storedValueForKey(NameKey);
}
public void setName(String value) {
takeStoredValueForKey(value,NameKey);
}
public Number budget() {
return (Number)storedValueForKey(BudgetKey);
}
public void setBudget(Number value) {
takeStoredValueForKey(value,BudgetKey);
}
public NSArray movies() {
return (NSArray)storedValueForKey(MoviesKey);
}
public void setMovies(NSMutableArray value) {
takeStoredValueForKey(value,MoviesKey);
}
public void addToMovies(EOEnterpriseObject object) {
NSMutableArray movies;
movies = (NSMutableArray)storedValueForKey(MoviesKey);
willChange();
movies.addObject(object);
}
public void removeFromMovies(EOEnterpriseObject object) {
NSMutableArray movies;
movies = (NSMutableArray)storedValueForKey(MoviesKey);
willChange();
movies.removeObject(object);
}
public void buyAllMoviesStarringTalent(Talent talent) {
invokeRemoteMethod
("clientSideRequestBuyAllMoviesStarringTalent",
new Object[] {talent});
}
}